import java.util.Scanner;

public class Verificationcode
{
    public static void main(String[] args)
    {
        //生成一个随机的验证码
        //1.请输入要生成的验证码位数
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要生成的验证码位数");
        int n = sc.nextInt();
        String code = "";
        //2.生成验证码
        for(int i=0;i<n;i++)
        {
            int number = (int)(Math.random()*3);
            switch ( number)
            {
                case 0:
                    code += (char)(Math.random()*26+'a');
                    break;
                case 1:
                    code += (char)(Math.random()*26+'A');
                    break;
                case 2:
                    code += (int)(Math.random()*10);
                    break;
            };
        }
        System.out.println("验证码是："+code);
    }
}
